<template>
  <div class="container">
    <div class="container-1200">
      <div class="title mg-B20">审核项目资料</div>
      <div>
        <el-row class="rowBorder rowTopBorder" >
          <el-col :span="12" class="col-flex request bg-ccc colLeftBorder">项目名称</el-col>
          <!-- <el-col :span="4" class="col-flex request bg-ccc colLeftBorder">项目类别</el-col> -->
          <el-col :span="6" class="col-flex request bg-ccc colLeftBorder">企业名称</el-col>
          <el-col :span="6" class="col-flex request bg-ccc colLeftBorder">启动时间</el-col>
          <!-- <el-col :span="6" class="col-flex colLeftBorder bg-ccc">三年计划:投资、预计收益、创就业岗位数</el-col> -->
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex colLeftBorder">
            <div class="colCell minH50 flexWithJusCenter" >
            {{ projectInfo.projectName}}
            </div>
            </el-col>
          <!-- <el-col :span="4" class="col-flex colLeftBorder">
            <div class="colCell minH50 flexWithJusCenter" >
            {{ projectCategoryFormate(projectInfo.projectCategoryId) }}
            </div>
            </el-col> -->
            <el-col :span="6" class="col-flex colLeftBorder">
            <div class="colCell minH50 flexWithJusCenter" >
            {{ projectInfo.compnayName }}
            </div>
            </el-col>
          <el-col :span="6" class="col-flex colLeftBorder">
            <div class="colCell minH50 flexWithJusCenter" >
            {{ dateFormatter(projectInfo.startDate) }}
            </div>
            </el-col>
          <!-- <el-col :span="6" class="col-flex colLeftBorder"> 
            <div class="colCell minH50 flexWithJusCenter" >
            {{ projectInfo.syjh }}
            </div>
            </el-col> -->
        </el-row>
          <el-row class="rowBorder bg-ccc">
          <el-col :span="4" class="col-flex request  colLeftBorder">建设内容</el-col>
            <el-col :span="20" class="col-flex colLeftBorder bg-fff">
            <div class="colCell" >
              {{ projectInfo.jsnr }} 
            </div>
            </el-col>
          </el-row>
          <el-row class="rowBorder bg-ccc">
          <el-col :span="4" class="col-flex request  colLeftBorder">建设目标</el-col>
            <el-col :span="20" class="col-flex colLeftBorder bg-fff">
            <div class="colCell" >
              {{ projectInfo.jsmb }} 
            </div>
            </el-col>
          </el-row>
          <el-row class="rowBorder bg-ccc">
          <el-col :span="4" class="col-flex request  colLeftBorder">项目概述</el-col>
            <el-col :span="20" class="col-flex colLeftBorder bg-fff">
            <div class="colCell" >
              {{ projectInfo.xmgs }} 
            </div>
            </el-col>
          </el-row>
          <el-row class="rowBorder bg-ccc">
          <el-col :span="4" class="col-flex colLeftBorder">商业计划书</el-col>
            <el-col :span="20" class="col-flex colLeftBorder bg-fff">
            <div class="colCell" >
              <el-link :href="projectInfo.meta" target="_blank" type="primary" class="link">商业计划书</el-link> 
            </div>
            </el-col>
          </el-row>
        
        <!-- <el-row class="rowBorder" >
          <el-col :span="24" class="col-flex">企业基本情况（一）</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 request bg-ccc">企业名称</el-col>
          <el-col :span="12" class="col-flex leftAlign-pd30 colLeftBorder">{{
            projectInfo.compnayName
          }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">企业负责人</el-col>
          <el-col :span="12" class="col-flex leftAlign-pd30 colLeftBorder">{{
            projectInfo.linkman
          }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
            >企业负责人联系人电话</el-col
          >
          <el-col :span="12" class="col-flex leftAlign-pd30 colLeftBorder">{{
            projectInfo.phone
          }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">企业等级注册类型</el-col>
          <el-col :span="12" class="col-flex leftAlign-pd30 colLeftBorder">{{
            registrationFormate(projectInfo.registration)
          }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">行业类型</el-col>
          <el-col :span="12" class="col-flex leftAlign-pd30 colLeftBorder">{{
            industryFormate(projectInfo.industry)
          }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">企业纳税人类型</el-col>
          <el-col :span="12" class="col-flex leftAlign-pd30 colLeftBorder">{{
            taxTypeFormate(projectInfo.taxType)
          }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 request bg-ccc ">是否高新科技企业</el-col>
          <el-col :span="12" class="col-flex leftAlign-pd30 colLeftBorder">{{
            projectInfo.isHighSalary == true ? "是" : "不是"
          }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 request bg-ccc ">是否科技型中小企业</el-col>
          <el-col :span="12" class="col-flex leftAlign-pd30 colLeftBorder">{{
            projectInfo.isKjxzxqy == true ? "是" : "不是"
          }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 request bg-ccc "
            >是否有IPO、新三板、并购退出</el-col
          >
          <el-col :span="12" class="col-flex leftAlign-pd30 colLeftBorder">{{
            projectInfo.isIpo == true ? "是" : "不是"
          }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 request bg-ccc "
            >融资轮次（种子、天使、A、B、C）</el-col
          >
          <el-col :span="12" class="col-flex leftAlign-pd30 colLeftBorder">{{
            lzjdFormate(projectInfo.lzjd)
          }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 request bg-ccc ">企业资产估值</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">万元</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.zcgz }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">指标</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">计量单位</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> 数量</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="24" class="col-flex">一、企业基本情况</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
            >获得天使或风险投资额</el-col
          >
          <el-col :span="4" class="col-flex  colLeftBorder">千元</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.lzjr }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">企业成立时注册资本</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">千元</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.zczb }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="24" class="col-flex">二、企业经济情况</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
            >企业2020至今的投资额</el-col
          >
          <el-col :span="4" class="col-flex  colLeftBorder">千元</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.bytz }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">企业上年总收入</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">千元</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.sbysl }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">当年获得政府资金</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">千元</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.dyzfzj }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">企业净利润</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">千元</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.qyjll }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">企业出口总额</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">千元</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.qyzck }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
            >企业研究与试验发展（R&D）经费支出</el-col
          >
          <el-col :span="4" class="col-flex  colLeftBorder">千元</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.rdjfzc }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">企业实际上缴税费</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">千元</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.qysjsjsf }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="24" class="col-flex">三、企业从业人员情况</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">企业从业人员</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">人</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.employeeNum }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd40 bg-ccc">其中：博士</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">人</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.bsyg }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">硕士</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">人</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.ssyg }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">本科</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">人</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.bkyg }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">大专</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">人</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.dzyg }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">留学人员</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">人</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.lxry }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">千人计划人数</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">人</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.zrjlrs }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">百人计划人数</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">人</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.sbrcrs }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">吸纳应届大学毕业生</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">人</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.yjbys }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="24" class="col-flex">四、企业知识产权情况</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">当年知识产权申请数</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">件</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.zscqsq }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">当年只是产权授权数</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">件</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.zscqsqs }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd40 bg-ccc">其中：发明专利</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">件</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.zscqfmzl }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">拥有有效知识产权数</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">件</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.yyzscqs }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd40 bg-ccc">其中：发明专利</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">件</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.yxzscqs }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">软件著作权</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">件</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.rjzzq }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">植物新品种</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">个</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.zwxpz }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">集成电路布图</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">个</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.jcdlbt }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">PCT专利</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">个</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.pct }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">购买国外专利</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">件</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.gmgwzl }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">技术合同交易数量</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">项</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.jshtjys }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">技术合同交易额</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">千元</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.jshtjyr }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
            >当年承担国家级科技计划项目数</el-col
          >
          <el-col :span="4" class="col-flex  colLeftBorder">项</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.gjkjxms }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
            >当年获得市级以上奖励</el-col
          >
          <el-col :span="4" class="col-flex  colLeftBorder">项</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.cjysjl }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="24" class="col-flex">五、产学研合作情况</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">产学研合作项目数</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">个</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.cxyhzxm }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc"
            >产学研合作项目总金额</el-col
          >
          <el-col :span="4" class="col-flex  colLeftBorder">千元</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.cxyhzjr }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="24" class="col-flex">六、双创载体建设情况</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd30 bg-ccc">建设双创载体的数量</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">个</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.jssczts }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd40 bg-ccc">其中：孵化器</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">个</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.fhq }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">众创空间</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">个</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.zckj }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">台青创基地</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">个</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.dqjd }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">技术创新中心</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">个</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.jscxzx }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">工程研究中心</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">个</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.gcyjzx }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">产业创新中心</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">个</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.cycxzx }}</el-col>
        </el-row>
        <el-row class="rowBorder" >
          <el-col :span="12" class="col-flex leftAlign-pd80 bg-ccc">新兴研发机构</el-col>
          <el-col :span="4" class="col-flex  colLeftBorder">个</el-col>
          <el-col :span="8" class="col-flex leftAlign-pd30 colLeftBorder"> {{ projectInfo.xxyfjg }}</el-col>
        </el-row> -->
        <!-- <el-row class="rowBorder">
          <el-col :span="4" class="col-flex">项目状态</el-col>
         <el-col :span="8" class="col-flex colLeftBorder colRightBorder">{{ projectStatusFormate(projectInfo.status) }}</el-col>
          <el-col :span="4" class="col-flex">驳回说明</el-col>
         <el-col :span="8" class="col-flex colLeftBorder ">{{ projectInfo.memo }}</el-col>
        </el-row> -->
      </div>
      <div class="mg-T20">
        <el-form
          :model="auditForm"
          :rules="auditFormRules"
          ref="auditForm"
          label-width="80px"
          class="demo-ruleForm"
        >
          <el-form-item label="驳回说明" prop="memo" v-if="type == 'audit'">
            <el-input type="age" v-model="auditForm.memo"></el-input>
          </el-form-item>
          <el-form-item v-if="type == 'audit'">
            <el-button type="primary" @click="adopt('auditForm')"
              >审核通过</el-button
            >
            <el-button type="danger" @click="reject('auditForm')"
              >审核驳回</el-button
            >
          </el-form-item>
          <el-form-item v-if="type == 'edit'">
            <el-button type="primary" @click="adoptEdit('auditForm')"
              >同意订正</el-button
            >
            <el-button type="danger" @click="rejectEdit('auditForm')"
              >订正驳回</el-button
            >
          </el-form-item>
        </el-form>
      </div>
    </div>
  </div>
</template>

<script>
import LangSelect from "@/components/LangSelect";
import { validUsername } from "@/utils/validate";
import utils from "@/utils/utils.js";
import { list as dictList } from "@/api/dict";
import { find as projectFind, adopt as projectAdopt,
  reject as projectReject, update} from "@/api/adminProject";

export default {
  components: {},
  name: "projectAudit",
  data() {
    const validatePassword = (rule, value, callback) => {
      if (value.length < 6) {
        callback(new Error("密码不能少于6位"));
      } else {
        callback();
      }
    };
    var alidateMemo = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请输入驳回说明"));
      } else {
        callback();
      }
    };
    return {
      projectId: "",
      companyId: "",
      projectInfo: {},

      //获取字典的promise
      taxTypeDictPromise: "",
      registrationDictPromise: "",
      lzjdDictPromise: "",
      projectStatusPromise:"",
      projectStatusDict:[],
      industryDict:[],
      industryDictPromise:"",
      projectCategoryDict:[],
      projectCategoryDictPromise:"",

      //审核表单
      auditForm: {
        memo: "", //驳回说明
      },
      auditFormRules: {
        memo: [{ validator: alidateMemo, trigger: "blur" }],
      },

      scroll:"",
      path: "",

      //类型
      type:"",
    };
  },
  watch: {
    $route: {
      handler: function (route) {
        this.path = route.path
      },
      immediate: true,
    },
  },

  activated() {
    if (this.$store.getters.closeAliveName == "projectAudit" ) {
      console.log("activated执行了--", this.$store.getters);
      console.log("this.projectId--", this.projectId);
      console.log("this.$route.query.projectId--", this.$route.query.projectId);
      if(this.projectId == this.$route.query.projectId && this.type == this.$route.query.type){
        if(this.scroll > 0){
          window.scrollTo(0, this.scroll);
          this.scroll = 0;
        }    
      }else{
        this.auditForm.memo = ""
        this.scroll = 0;
        this.type = this.$route.query.type
        this.projectId = this.$route.query.projectId;
        this.companyId = this.$route.query.companyId;
        this.getProjectInfo(this.projectId);
      }
      this.$store.dispatch("user/cleanCloseAliveName");
    }else{
      if(this.scroll > 0){
       window.scrollTo(0, this.scroll);
       this.scroll = 0;
      }
    }
    window.addEventListener('scroll', this.handleScroll);
  },
  deactivated(){
     window.removeEventListener('scroll', this.handleScroll);
},

  created() {
    this.taxTypeDictPromise = this.getDictList("tax_type", (res) => {
      this.taxTypeDict = res.data;
    });
    this.registrationDictPromise = this.getDictList("registration", (res) => {
      this.registrationDict = res.data;
    });
    this.lzjdDictPromise = this.getDictList("lzjd", (res) => {
      this.lzjdDict = res.data;
    });
    this.projectStatusPromise = utils.getDictList("project_status", (res) => {
      this.projectStatusDict = res.data;
    });
    this.industryDictPromise = utils.getDictList("industry", (res) => {
      this.industryDict = res.data;
    });
    this.projectCategoryDictPromise = utils.getDictList("projectCategory", (res) => {
      this.projectCategoryDict = res.data;
    });
  },

  mounted() {
    window.addEventListener('scroll', this.handleScroll);
    console.log('this.taxTypeDictPromise--',this.taxTypeDictPromise);
    Promise.all([
      this.taxTypeDictPromise,
      this.registrationDictPromise,
      this.lzjdDictPromise,
      this.industryDictPromise,
      this.projectStatusPromise,
      this.projectCategoryDictPromise
    ]).then((res) => {
      console.log('res--',res);
      if (this.$route.query) {
        this.projectId = this.$route.query.projectId;
        this.companyId = this.$route.query.companyId;
        this.type = this.$route.query.type
        this.getProjectInfo(this.projectId);
      }
    });
  },

  destroyed() {},

  methods: {
    //监听滚动条
    handleScroll () {
      let scrollTop = document.documentElement.scrollTop;
      this.scroll = scrollTop;
    },

    //获取项目信息
    getProjectInfo(projectId) {
      projectFind(projectId)
        .then((res) => {
          console.log("projectFind成功获取数据--", res);
          if (res.type == "success") {
            this.projectInfo = res.data.project;
          }
        })
        .catch((err) => {
          this.$message.error(err.msg);
        });
    },

    //字典信息获取
    getDictList(type, callback, errCallback) {
      let params = new URLSearchParams();
      params.append("dictType", type);
      return dictList(params)
        .then((res) => {
          console.log(type + "字典--", res);
          if (res.type == "success") {
            if (callback) {
              callback(res.data);
            }
          }
        })
        .catch((err) => {
          if (errCallback) {
            errCallback();
          }
        });
    },

    //企业审核
    adopt(Form) {
      let params = new URLSearchParams();
      params.append("projectId", this.projectId);
      projectAdopt(params).then((res) => {
        console.log("企业的审核通过--", res);
        if (res.type == "success") {
          this.$message.success("企业的审核通过");
          this.$store.dispatch("user/setCloseView", this.path)
          this.$router.push({
            path: "/project/auditList",
            query: { companyId: this.companyId },
          });
        }
      });
    },

    //审核驳回
    reject(formName) {
      this.$refs[formName].validate((valid) => {
        console.log("valid--", valid);
        if (valid) {
          let params = new URLSearchParams();
          params.append("projectId", this.projectId);
          params.append("rejectText", this.auditForm.memo);
          projectReject(params).then((res) => {
            console.log("企业的驳回--", res);
            if (res.type == "success") {
              this.$message.success("企业的审核已经驳回");
              this.$store.dispatch("user/setCloseView", this.path)
              this.$router.push({
                path: "/project/auditList",
                query: { companyId: this.companyId },
              });
            }
          });
        }
      });
    },

    adoptEdit(){
      this.projectInfo.status = 0
      update(this.projectInfo).then((res) => {
            console.log("统一订正--", res);
            if (res.type == "success") {
              this.$message.success("企业的订正申请已经同意");
              this.$store.dispatch("user/setCloseView", this.path)
              this.$router.push({
                path: "/project/auditList",
              });
            }
          });
    },

    rejectEdit(){
      this.projectInfo.status = 2
      update(this.projectInfo).then((res) => {
            console.log("企业的驳回--", res);
            if (res.type == "success") {
              this.$message.success("企业的订正申请已经驳回");
              this.$store.dispatch("user/setCloseView", this.path)
              this.$router.push({
                path: "/project/auditList",
              });
            }
          });
    },

    //字典数据格式化
    taxTypeFormate(data) {
      return utils.selectDictLabel(this.taxTypeDict, data);
    },

    registrationFormate(data) {
      return utils.selectDictLabel(this.registrationDict, data);
    },

    lzjdFormate(data) {
      return utils.selectDictLabel(this.lzjdDict, data);
    },

    dateFormatter(data){
      return utils.dateFormatter(data);
    },

    projectStatusFormate(data) {
      return utils.selectDictLabel(this.projectStatusDict, "project_status-"+data);
    },

    industryFormate(data) {
      return utils.selectDictLabel(this.industryDict, data);
    },

    projectCategoryFormate(data) {
      return utils.selectDictLabel(this.projectCategoryDict, data);
    },
  },
};
</script>

<style lang="scss" scoped>
</style>
